﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Chip8Dev.CPU;

namespace Chip8Dev
{
    public delegate void Interrupt();

    public sealed class Chip8Engine : IDisposable
    {
        /* Constants */
        private const Int32 StackSize = 12;
        private const Int32 VRegCount = 16;
        private const Int32 RPLCount = 8;
        private const Int32 EntryPoint = 512;

        /* Media Streams */
        private Stream m_FontStream;
        private Stream m_RomStream;

        /* Interrupts */
        public event Interrupt DrawInterrupt;
        public event Interrupt BuzzerInterrupt;

        /* Timers */
        private Timer m_InterpreterTimer;
        private Timer m_BuzzerTimer;
        private Timer m_DelayTimer;

        /* Chip8 Core */
        private CpuState m_State;
        private SystemMemory m_Memory;

        public CpuState CPUCoreState { get { return m_State; } }

        public SystemMemory Memory { get { return m_Memory; } }


        public void Dispose()
        {
            throw new NotImplementedException();
        }
    }

}
